%
%
% 10/02/2012
function [ colors ] = colorForField( field, expand )
n = size ( field, 1 );
MAX = max( field(:,1) );
MIN = min( field(:,1) );
colors = zeros(n,3);
field = field / abs(MAX);
for i = 1 : n
    if (expand == 0)
        colors(i,:) = color_map_BCGYR( field(i,1) );
    else
        colors(i,:) = color_map_BCGYR( scale_expand_within_0_1(field(i,1), expand) );
    end % if
end % for

%{
colorInfo = zeros(n, 2);
colorInfo(:, 1) = abs(field);
colorInfo(:, 2) = [1:n]';
colorInfo = sortrows(colorInfo, 1);
%}

%[c, outColor] = getColor(colorInfo, n);

%{ 
colorList = fliplr( rainbow(c) );
colors = zeros(n,3);
for i = 1:n
    indexVert = outColor(i, 2);
    indexColor = outColor(i, 3);
    colors(indexVert, :) = colorList(indexColor,:);
end % for
%}

end % function

